<div class="product-list" style="margin-bottom:15px;">
	<div style="padding:4px;margin:2px 0px" align="center">
		<a href="content_category.html"><span style="color:#0000FF;font-size:16px"><strong>CHUYỂN TIN GIỮA CÁC DANH MỤC</strong></span></a>
	</div>
	<div id="filter">
		<table width="100%" cellpadding="5" cellspacing="0" style="border:1px solid #999;">
		  <tr>
		    <td colspan="2" nowrap="nowrap" bgcolor="#ffffff">{$msg}</td>
	      </tr>
		  <tr>
			<td bgcolor="#E1F0FF" width="35%" nowrap="nowrap"><strong>Danh mục cũ</strong></td>
			<td bgcolor="#E1F0FF" nowrap="nowrap"><strong>Từ khóa</strong></td>
		  </tr>
		  <tr>
		  	<td rowspan="2" style="vertical-align:top;">
				<br />
				{html_options id=sourceCategories name=sourceCategories options=$sourceCategories style="width:280px;" size="10" selected=$cat_search_id}
				<input type="hidden" id="searchedCategory" name="searchedCategory" value="{$cat_search_id}" />
				<input type="hidden" id="searchedKeywords" name="searchedKeywords" value="{$keywords}" />
			</td>
			<td style="vertical-align:top;">
				<br />
				<input type="text" id="searchKeyword" name="searchKeyword" value="{$keywords}" size="70" />
			</td>
		  </tr>
		  <tr>
		    <td style="vertical-align:top;"><input type="button" name="btnSearch" class="btnSearch" onclick="ManageContentCategoryForm.submit();" value="Tìm kiếm" style="width:200px;height:30px;cursor:pointer"/></td>
	      </tr>
		 </table>
	</div>
</div>
{if $allrecord}	
	<div id="search_area">
		<div class="header_search" style="text-align:left;margin-bottom:10px;">
			Tìm thấy <b>{$allrecord}</b> kết quả {if $keywords} với từ khóa <span class='s'>{$keywords}</span>{/if} {if $cat_search_id} trong danh mục <span class='s'>{$cat_search_name}</span>{/if}
			{if $cat_search_id || $keywords}
				<table>
					<tr>
						<td>
							<b>Danh mục cần chuyển đến</b><br />
							{html_options id=desCategories name=desCategories options=$desCategories style="width:280px;" size="10" selected=$category_id}
						</td>
					</tr>
				</table>
                <input type="hidden" name="itemids" id="itemids" value="{$itemids}"/>
				<input type="hidden" name="hidMoveItem" id="hidMoveItem" value="" />
				<input type="button" name="btnMoveItem" id="btnMoveItem" value="Chuyển Tin" onclick="return MoveItem();" style="width:200px;height:30px;cursor:pointer;margin-left:300px"/>
			{/if}
		</div>
	</div>
{else}
	<div id="search_area" style="text-align:left"> 	
 		Không tìm thấy giao dịch nào {if $keywords} với từ khóa <span class='s'>{$keywords}</span>{/if} {if $cat_search_id} trong danh mục <span class='s'>{$cat_search_name}</span>{/if}<br><br>
 	</div>
{/if}

</div>
<script type="text/javascript">
	var desCategories = {$desJSONCategories};
	var selectedValue = 0;
	{literal}
		function MoveItem()
		{
			var desCat = window.document.getElementById('desCategories');
			if(desCat.value == '')
			{
				alert('Hãy chọn danh mục cần chuyển đến!');
				return false;
			}
			var form = window.document.forms.ManageContentCategoryForm;
			form.hidMoveItem.value = 'MoveItem';
			form.submit();
			return true;
		}
		jQuery(document).ready(function(){
			jQuery('#desCategories').change(function(){
				var catid = jQuery(this).val();
				var selectedValue = 0;
				var parent = desCategories[catid]['parent_id'].split(',');
				var topid = parent[parent.length - 1];
				if(topid > 0) catid = topid;
			});	
		});
	{/literal}
</script>
		